/* --- Variables & Reset --- */
:root {
    --bg-beige: #F5F5DC;
    --bg-maroon: #800000;
    --text-beige: #F5F5DC;
    --text-maroon: #800000;
    --font-main: "Roboto Slab", serif;
}
html{
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--bg-maroon); 
    padding: 2rem 2rem;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo {
    height: 50px; 
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-beige);
    text-decoration: none;
    font-weight: 700;
    transition: opacity 0.3s;
    font-size: 1.3rem;
}

.nav-links a:hover {
    opacity: 0.8;
}

.nav-links a.active {
    color: var(--bg-beige);
    border-bottom: 3px solid var(--bg-beige);
    padding-bottom: 5px;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
}

/* Desktop: dropdown-header is invisible, children display normally */
.dropdown-header {
    display: contents; /* Makes wrapper invisible on desktop */
}

/* Mobile dropdown toggle button - hidden on desktop */
.dropdown-toggle-mobile {
    display: none;
    color: var(--text-beige);
    font-size: 0.9em;
    cursor: pointer;
    padding: 0.5rem;
    user-select: none;
    transition: transform 0.3s;
}

/* Create an invisible bridge between link and dropdown */
.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-maroon);
    list-style: none;
    padding: 0.5rem 0;
    margin-top: 0;
    padding-top: 0.5rem;
    min-width: 220px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    z-index: 1001;
    overflow: hidden;
    pointer-events: none;
}

/* Desktop: dropdown appears on hover */
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.7rem 1.2rem;
    color: var(--text-beige);
    font-size: 1.1rem;
    font-weight: 600;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: rgba(245, 245, 220, 0.1);
    opacity: 1;
}

/* Active child item in dropdown */
.dropdown-menu a.active {
    background-color: rgba(245, 245, 220, 0.2);
    border-left: 3px solid var(--bg-beige);
}

/* Non-link dropdown labels (Talks, Competitions) */
.dropdown-toggle:not([href]) {
    cursor: default;
}

.hamburger {
    display: none; /* Hidden on desktop */
    cursor: pointer;
}
.logo_title{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    color: var(--text-beige);
    font-size: 1.5rem;
}

/* --- Hero Section --- */
#hero {
    background-color: var(--bg-beige);
    color: var(--text-maroon);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 60px; /* Offset for fixed navbar */
}

.hero-logo {
    max-width: 200px;
    margin-bottom: 1rem;
}

#hero h1 {
    font-size: 4.3rem;
    font-weight: 900;
    padding-bottom: 30px;
}
#hero a {
    text-decoration: none;
    background-color: var(--text-maroon);
    color: var(--text-beige);
    padding: 15px 15px;
    border-radius: 10%;
}

/* --- Mission Section --- */
#mission {
    background-color: var(--bg-maroon);
    color: var(--text-beige);
    padding: 4rem 2rem;
    text-align: center;
}

#mission h2 {
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- Explanation Section --- */
#explanation {
    background-color: var(--bg-beige);
    color: var(--text-maroon);
    padding: 4rem 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.grid-item {
    text-align: center;
}

.grid-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--text-maroon);
    margin-bottom: 1rem;
}

.grid-item h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}
#team{
    background-color: var(--bg-maroon);
    color: var(--text-beige);
    padding: 4rem 2rem;
    text-align: center;
}
#team h2{
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/*Testimonial section*/
#testimonial{
    background-color: var(--bg-maroon);
    color: var(--text-beige);
    padding: 4rem 2rem;
    text-align: center;
}
#testimonial h2{
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- Footer --- */
footer {
    background-color: var(--bg-maroon);
    color: var(--text-beige);
    padding: 2rem;
    text-align: center;
}

.socials {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.socials a {
    color: var(--text-beige);
    text-decoration: underline;
}
.link{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
.link a{
    text-decoration: none;
}
/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }
    
    .hamburger span {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px;
        background-color: var(--text-beige);
    }


    .nav-links {
        position: absolute;
        top: 60px;
        right: 0;
        background-color: var(--bg-maroon);
        flex-direction: column;
        width: 50%;
        height: calc(100vh - 60px);
        align-items: center;
        padding-top: 2rem;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        gap: 0; /* Remove gap on mobile */
    }
    
    .nav-links > li {
        width: 100%;
        text-align: center;
        padding: 0.8rem 0;
    }

    .nav-links.active {
        transform: translateX(0%);
    }

    /* Mobile dropdown styles */
    .dropdown-menu {
        display: block !important; /* Show on mobile */
        position: static !important;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transform: none !important;
        margin-top: 0;
        box-shadow: none;
        border-radius: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        pointer-events: auto;
        background-color: rgba(0, 0, 0, 0.3);
        width: 100%;
    }

    .dropdown:hover .dropdown-menu {
        opacity: 0;
        visibility: hidden;
        max-height: 0;
    }

    .dropdown.active .dropdown-menu {
        opacity: 1;
        visibility: visible;
        max-height: 400px;
        margin-top: 0;
        margin-bottom: 0;
    }

    .dropdown-menu a {
        padding: 0.6rem 2rem;
        background-color: rgba(0, 0, 0, 0.2);
        border-bottom: 1px solid rgba(245, 245, 220, 0.1);
    }
    
    .dropdown-menu a:last-child {
        border-bottom: none;
    }
    
    /* Show and style the mobile dropdown toggle */
    .dropdown-toggle-mobile {
        display: inline-block;
        margin-left: 0.5rem;
        transition: transform 0.3s ease;
    }
    
    .dropdown.active .dropdown-toggle-mobile {
        transform: rotate(180deg);
    }
    
    /* Arrange UGS text and arrow horizontally on mobile */
    .dropdown {
        width: 100%;
        display: flex;
        flex-direction: column; /* Changed to column so dropdown flows below */
        align-items: center;
        position: relative;
    }
    
    .dropdown-header {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }
    
    .dropdown .nav-link {
        margin: 0;
    }
    
    .dropdown-menu {
        position: static !important; /* Keep static so it pushes content down */
        width: 100%;
    }

    #hero h1 {
        font-size: 3.3rem;
    }
}
/*Stretching the navbar on desktop*/
@media (min-width: 769px) {
    .nav-container {
        max-width: 95%; /* Stretches the content wide */
    }
}